const express = require("express")
const router = express.Router()
const userinfoHandler = require("../router_handler/userinfo")
const expressJoi = require("@escook/express-joi")
const { update_userinfo_schema, update_password_schema,update_avatar_schema } = require("../schema/user")
// 获取数据的路由
router.get('/userinfo', userinfoHandler.getUserinfo)
//  更新数据路由
router.post('/userinfo', expressJoi(update_userinfo_schema), userinfoHandler.updateUserinfo)
// 更新密码的路由
router.post("/updatepwd", expressJoi(update_password_schema), userinfoHandler.updatePwd)
// 更新用户头像的路由
router.post("/update/avatar",expressJoi(update_avatar_schema),userinfoHandler.updateAvatar)
module.exports = router